package com.lanou3g.code0423;

import java.io.*;
import java.util.Set;

/**
 * If there are no bugs, it was created by Chen FengYao on 2018/4/23;
 * Otherwise, I don't know who created it either
 */

public class Main {
    public static void main(String[] args) throws Exception {

        FileInputStream f1 = new FileInputStream("aaa.txt");

        byte[] buf = new byte[1024];
        int length = f1.read(buf);
        String s = new String(buf,0,length,"gbk");

        FileOutputStream f2 = new FileOutputStream("aa.txt");
        f2.write(s.getBytes("utf8"));

        f1.close();
        f2.close();

    }
}
